/*
*	Copyright (C) 2014  Julio Montes, Mario Carrillo
*	
*	Julio Montes e-mail: imc.coder@gmail.com 
*
*	Mario Carrillo e-mail: mario_90ago@live.com.mx
*
*	BSD 3-Clause License
*/

#ifndef FILECREATOR_H
#define FILECREATOR_H

#include <wx/wx.h>
#include <vector>
#include <iostream>
#include <fstream>
#include <math.h>
#include <fstream>
#include <sstream>

#define ID_OK2 11
#define ID_CANCEL2 22

using namespace std;

namespace alliance
{
class FileCreator:public wxDialog
{
public:
    FileCreator(const wxString& title,char FileNameIn[],char FileNameOut[],int TypeFile);
    virtual ~FileCreator();
    bool GetErrorFileCreation();

private:
    void ShowInterfaceValuesFileIOC();
    void ShowInterfaceValuesFilePAT();
    void CreatFileIOC(char FileNameOutIOC[]);
    void CreatFilePAT(char FileNameOutPAT[]);
    void AnalyzerFile(char FileNameIn[]);
    string ConvertionBinary(int num,int limit);
    void MakeCastingSize(string *v1,string *v2,int *SI);
    void WriteFileIOC(ofstream *WF,int j,int i,int Flag);
    void OnOk(wxCommandEvent& event);
    void OnCancel(wxCommandEvent& event);

    bool Errors;
    wxStaticText *Instruction,*Instruction2;
    wxComboBox *files;
    wxButton *ButtonOk;
    wxButton *ButtonCancel;
    wxTextCtrl *FieldNameFileOut;

    int TF;
    wxStaticText  *LabelT;
    wxStaticText  *LabelTimeStart;
    wxStaticText  *LabelTimeIncr;
    wxStaticText  *LabelTimeUnit;

    wxStaticText  *LabelIncrease;
    wxStaticText  *LabelName;
    wxStaticText  *LabelType;
    wxStaticText   *LabelPosition;
    wxStaticText  *LabelRepetition;

    wxTextCtrl    *StartTime;
    wxTextCtrl    *IncreTime;
    wxTextCtrl    *UnitTime;
    wxTextCtrl    *Repetition;


    wxScrolledWindow *AreaValues;
    wxArrayString Position_Values;
    vector<wxComboBox *> vectorCheck;
    vector<wxStaticText *> vectorInOut;
    vector<wxTextCtrl *> vectorValueSignalPAT;



    char *FileOutFC;

    struct IN_OUTS
    {
        string NameInOut;
        string ModeInOut;
        unsigned int    SizeIntInOut;
        unsigned int Acum;


    };

    struct IN_OUTS Node;
    vector <IN_OUTS> v;
    vector <string> VectorInOuts;

    size_t  EqualsSize;
    size_t i;

    //DECLARE_EVENT_TABLE()

};
}

#endif // FILECREATOR_H

